<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@include file="/include/public.jspf"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta name="format-detection" content="telephone=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-base.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/m-common.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/p-all.css" />
<link rel="stylesheet" type="text/css" href="${path }/css/default/member.css" />
<script type="text/javascript" src="${path }/js/jquery1.10.2.min.js"></script>
<script type="text/javascript" src="${path }/js/morepaging-register.js"></script><!-- 分页数据拼接 -->
<script type="text/javascript" src="${path }/js/helper.js"></script>
<script type="text/javascript" src="${path }/js/common/base.js"></script>

<title>魔环金融</title>
</head>
<body>
  <div class="ui_title">
        <a class="ui_back" href="${path }/member/center.htm"><i class="ui_icon_back"></i>返回</a>
        我的红包</div>
    <section class="m-main p_account_bonus p_account_invitation">
    
       <ul class="ui_tab_nav ui_tab_num3 ui_border_t">
           <li class="select"><span>注册红包<em></em></span></li>
           <li class=""><span><a href="${path }/redpacket/redlist.htm?type=2">投资红包</a><em></em></span></li>
           <li class=""><span><a href="${path }/redpacket/redlist.htm?type=3">分享红包</a><em></em></span></li>
      </ul>
      <div class="mt15">
	<div class="tab_box">
	<!-- 注册红包 -->
      <div class="tab1">
          <div class="bonus-reclist bg-white ui_border_b" id="list_more"></div>
		  <div class="ui_loadmore_text">
		  <input type="hidden" value="" id="pagenumber">
			 <a href="javascript:void(0);" class="more">点击加载更多</a>
		  </div>
      </div>
	</div>    
   </div>
   </section>
    
    <script type="text/javascript">
  //加载更多--分页
	    	var isLogin = ${isLogin};
	    	if(!isLogin){
	    		window.location.href="${path }/user/login/index.jsp";
	    	}
	        // tab事件绑定
	        var page = 2;
	        $(document).on('click','.more',function(){
	            reqData(page, '#list_more');
	            page++;
	        });
	     	// ajax请求
			function reqData(page, pageSelector) {
				$('.ui_loadmore_text').html('<div class="ui_loading"><div class="bar1"></div><div class="bar2"></div><div class="bar3"></div><div class="bar4"></div><div class="bar5"></div><div class="bar6"></div><div class="bar7"></div><div class="bar8"></div><div class="bar9"></div><div class="bar10"></div><div class="bar11"></div><div class="bar12"></div></div>&nbsp;&nbsp;正在加载');
				$.ajax({
					url : '${path }/redpacket/list.htm',
					type : 'post',
					data : {
						curPage : page,
						type:1,
					},
					success : function(data) {
						data = $.parseJSON(data);
						addHtml(data);
						if (data.pageCount[0] <= 0) {
							$(pageSelector).hide();
							return;
						} else {
							$(pageSelector).show();
						}
					},
					error : function() {
					}
				})
			}
			// 初始数据
	        reqData(1,'#list_more');
    
    
    var inviteFlag = 1;
    //判断是否微信
    function weixinFacility() {
        var userAgentString = window.navigator ? window.navigator.userAgent : "";
        var weixinreg = /MicroMessenger/i;
        return weixinreg.test(userAgentString);
    };
    if (inviteFlag){
        $('.p_account_invitation').append('<div class="share_wrap"><div class="share_cover"></div><div class="share_box"></div></div>');
        if(weixinFacility()){
          $('.share_wrap').append('<div class="wx_tip"></div>');
          $('.share_box').append('<div class="line"><div class="part"><a class="wx_hy">微信好友</a></div><div class="part"><a class="wx_pyq">朋友圈</a></div><div class="part"><a class="jiathis_button_tsina">新浪微博</a></div><div class="part"><a class="jiathis_button_tqq">腾讯微博</a></div></div><div class="line"><div class="part"><a class="jiathis_button_qzone">QQ空间</a></div><div class="part"><a class="jiathis_button_douban">豆瓣</a></div><div class="part"></div><div class="part"></div></div>');
          $('.wx_hy,.wx_pyq').click(function(event) {
            $('.wx_tip').show();
          });
          $('.wx_tip').click(function(event) {
            $(this).hide();
          });
        } else {
         // $('.share_box').append('<div class="line"><div class="part"><a class="jiathis_button_tsina">新浪微博</a></div><div class="part"><a class="jiathis_button_tqq">腾讯微博</a></div><div class="part"><a class="jiathis_button_qzone">QQ空间</a></div><div class="part"><a class="jiathis_button_douban">豆瓣</a></div></div>');
        	 $('.share_box').append('<div class="line"><div class="part"><a class="wx_hy">微信好友</a></div><div class="part"><a class="wx_pyq">朋友圈</a></div></div>');
             
        }
        $('#inviteBtn').click(function(event) {
          $('.share_wrap').addClass('show');
        });
        $('.share_wrap .share_cover').click(function(event) {
          $('.share_wrap').removeClass('show');
        });
    } else {
      $('#inviteBtn').attr('disabled','disabled');
    }
    </script>

</body>
</html>